/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
* @description /
* @author shitou
* @date 2024-04-21
**/
@Data
@TableName("question")
public class Question implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "题干")
    private String name;

    @ApiModelProperty(value = "学校id")
    private Long schoolId;

    @ApiModelProperty(value = "附件")
    private String url;

    @ApiModelProperty(value = "题型")
    private Integer questionTypeId;

    @ApiModelProperty(value = "解析")
    private String analysis;

    @ApiModelProperty(value = "难度")
    private Integer difficulty;

    @ApiModelProperty(value = "是否发布")
    private Integer isPublish;

    @ApiModelProperty(value = "必须按顺序填写")
    private Integer isOrder;

    @ApiModelProperty(value = "是否上传图片")
    private Integer isUpload;

    @ApiModelProperty(value = "创作人")
    private Long teacherId;

    @ApiModelProperty(value = "是否共享")
    private Integer isShare;

    @ApiModelProperty(value = "lastupdatetime")
    private Integer lastupdatetime;

    @TableField(exist = false)
    private List<Questionoption> questionoptions;

    @TableField(exist = false)
    private List<Userquestionlog> userquestionlogs;

    @TableField(exist = false)
    private List<TeskExerciseSetRecord> teskExerciseSetRecord;

    private Integer type;

    @ApiModelProperty(value = "字母区分大小写")
    private Integer isCaseSensitive;

    @ApiModelProperty(value = "必须按顺序填写")
    private Integer isTurnFill;

    @ApiModelProperty(value = "题干附件")
    private String stemFile;

    @ApiModelProperty(value = "解析附件")
    private String analysisFile;

    @ApiModelProperty(value = "是否允许答题者上传图片附件")
    private Integer isAllowUploadFile;



    @TableField(exist = false)
    private String score;

    @TableField(exist = false)
    private String questiontypename;

    @TableField(exist = false)
    private String answerArr;

    private String createTime;

    @TableField(exist = false)
    private String teacherName;

    public void copy(Question source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
